<include file="Admin/Public/Header" />
<script src="__ADMIN__/js/Admin/common.js" type="text/javascript"></script>
<script src="__PUBLIC__/DatePicker/DatePicker.js" type="text/javascript"></script>
<link href="__PUBLIC__/DatePicker/Css/DatePicker.css" type="text/css" rel="stylesheet" />
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
    <tr>
        <td height="31"><div class="titlebt">商品列表</div></td>
    </tr>
</table>

<div class="main">
    <div class="operate">
        <div class="left_pad">
            <form method="post" action="{:U('Admin/Goods/Lists', 'do=Search')}" id="searchForm" name="searchForm">
                标题：<input type="text" name="keyword" title="关键字" class="inp_default" value="{$_GET['keyword']}" placeholder="请输入产品标题/卖家名/卖家电话号码">&nbsp;
                状态：<input type="hidden" name="status" id="status" value="{$_GET['status']}">
                <select id="selectS" class="inp_default">
                    <option value="">全部</option>
                    <option value="1">已上架</option>
                    <option value="0">待审核</option>
                    <option value="-1">已下架</option>
                    <option value="-2">审核不通过</option>
                    <option value="-3">商品已删除</option>
                </select>&nbsp;
                <label>发布时间：<input type="text" class="inp_default" style="width:180px; text-align: center;" name="date" id="datePicker" readonly /></label>
                <input type="submit" class="btn_blue" value="查  询">
                <script type="text/javascript">
                    var dateRange1 = new pickerDateRange('datePicker', {
                                isTodayValid: true,
                            <empty name="start">
                            startDate: '{:date('Y-m-d', time()-2592000)}',
                            endDate: '{:date('Y-m-d', time())}',
                    <else />
                    startDate: '{$start}',
                            endDate:   '{$end}',
                    </empty>
                    needCompare: false,
                            target: 'searchForm',
                            defaultText: ' ~ ',
                            autoSubmit: true,
                            inputTrigger: 'datePicker',
                            theme: 'ta',
                            magicSelect: false,
                    });
                </script>
            </form>
        </div>
    </div>
    <div class="list">
        <form action="{:U('Admin/Goods/Lists', 'do=sort')}" method="post" id="form_do" name="form_do">
            <table width="100%">
                <tr>
                    <th>编号</th>
                    <th>标题</th>
                    <th>商品分类</th>
                    <th>卖家名</th>
                    <th>发布时间</th>
                    <th>商品状态</th>
                    <th>库存</th>
                    <th>操作</th>
                </tr>

                <empty name="vlist">
                    <tr><td colspan="9">本区域暂无数据显示...</td></tr>
                    <else />
                    <volist name='vlist' id='v'>
                        <tr>
                            <td>{$v.goods_id}</td>
                            <td class="aleft"><a href="{:U('Admin/Goods/Lists', 'do=Edit&'.'id='.$v['goods_id'])}">{$v.goods_title}</a></td>
                            <td>
                                <volist name="v.goods_relation" id="vr" key="key">
                                <php>$t = count($v['goods_relation']);</php>
                                <if condition="$key gt 1">
                                    {$vr.gc_name} <if condition="$key lt $t">/</if>
                                </if>
                                </volist>
                            </td>
                            <td><empty name="v.member_name">{$v.member_mobile}<else />{$v.member_name}</empty></td>
                            <td>{$v.goods_time|date="Y-m-d G:i:s",###}</td>
                            <td class="status{$v.goods_status}"></td>
                            <td>{$v.goods_storage}</td>
                            <td>
                                <a href="{:U('Admin/Goods/Lists', 'do=Edit&id='.$v['goods_id'])}">查看详情</a>
                                <if condition="$v.goods_status == 0">
                                <a href="{:U('Admin/Goods/Lists', 'do=Verify&id='.$v['goods_id'].'&status=1')}"> 通过审核</a>
                                <a href="{:U('Admin/Goods/Lists', 'do=Verify&id='.$v['goods_id'].'&status=-2')}"> 审核不通过</a>
                                    </if>
                                <if condition="$v.goods_status == 1">
                                <a href="{:U('Admin/Goods/Lists', 'do=Verify&id='.$v['goods_id'].'&status=-1')}"> 下架</a>
                                    </if>
                                <if condition="$v.goods_status != -3">
                                <a href="{:U('Admin/Goods/Lists', 'do=Verify&id='.$v['goods_id'].'&status=-3')}"> 删除</a>
                                    </if>
                            </td>
                        </tr>
                    </volist>
                </empty>

            </table>
        </form>
    </div>
    <div class="page">{$show_page}</div>
</div>
<include file="Admin/Public/Copyright" />
<script type="text/javascript">
    $('.status1').html("已上架");
    $('.status0').html("待审核");
    $('.status-1').html("已下架");
    $('.status-2').html("审核不通过");
    $('.status-3').html("商品已删除");
    $("#selectS").find("option[value='{$_GET['status']}']").attr("selected",true);

    $('#selectS').change(function(){
        var v = $(this).val();
        $('#status').val( v );
    });

</script>
</body>
</html>

